<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\Base;
class Article extends Base
{
    public function setPicAttribute($value)
    {
       // dd($value);
        $this->attributes['pic'] = empty($value) ?  '/uploads/article/'.rand(1,6).'.png'  :  $value ;
    }


    public function getPicAttribute($value)
    {
        // dd($value);
       return  "http://www.hzf.com".$value;
    }

}
